const express = require("express");
const router = express.Router();
const settingsController = require("../controllers/settings.controller");
const { auth } = require("../middleware/auth.middleware");

// 获取设置
router.get("/", auth, settingsController.getSettings);

// 更新设置
router.put("/", auth, settingsController.updateSettings);

// 更新个人信息
router.put("/profile", auth, settingsController.updateProfile);

// 更新密码
router.put("/password", auth, settingsController.updatePassword);

// 获取登录设备
router.get("/devices", auth, settingsController.getLoginDevices);

// 登出设备
router.post("/devices/:deviceId/logout", auth, settingsController.logoutDevice);

// 添加头像上传路由
router.post("/upload/avatar", auth, settingsController.uploadAvatar);

// 测试邮件通知
router.post("/test-email", auth, settingsController.testEmailNotification);

module.exports = router;
